<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="http://119.23.182.180/jquery-3.5.1.min.js"></script>
    <script type="text/javascript">
        function send_ajax(){
            $.ajax({
                type:'GET',
                url:'/ad/1',
                dataType: 'json',
                success:(res)=>{
                    console.log(res);
                }


            })

        }

    </script>
    <script>
        //创建数据
        function ceateItem() {
            var obj = {};
            obj.content = $('.createContent').val();
            if (obj.content !== '') {
                $.get('http://localhost:3000/create', obj, function (res) {
                    console.log('新增成功');
                    searchItem();
                })
            } else {
                alert('不能为空');
            }
        }
    </script>
</head>
<body>
<div>
    <div>
        <div>
            <form class="initform" method="post" accept-charset="utf-8">
                <div class="from-group">
                    <label>输入内容</label>
                    <label>
                        <input class="form-control createContent" type="text" name="content" placeholder="Enter Todo" />
                    </label>
                </div>
                <div class="from-group" style="margin: 10px 0;">
                    <button type="button" class="btn btn-info" onclick="ceateItem()">新增</button>
                </div>
            </form>
        </div>
        <div>
            <button onclick="send_ajax()">click</button>
        </div>
        ejs 模板
        <%=mess%>
    </div>
    <div>
        <%-html_block%>
        <!--解析HTML标签-->
    </div>

</div>

</body>
</html>
